package com.finger.demo.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

public class ExcelListener extends AnalysisEventListener<ExcelData> {


    private static List  list = new ArrayList<ExcelData>();


    @Override
    public void invoke(ExcelData excelData, AnalysisContext analysisContext) {
        list.add(excelData);
    }

    public static List getList() {
        return list;
    }

    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        headMap.put(2,new Date().toString()+"头部信息");
        list.add(headMap);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
    }
}
